package com.jianzong.lingxuan.enums;

/**
 * @auth Leiwenlong
 * @since 2021/7/19
 */
public enum AdminEnum {

    USERLIST(0,"userList","查看用户列表"),
    NULL(999,"","");




    private int code;
    private String name;
    private String cnName;

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getCnName() {
        return cnName;
    }

    AdminEnum(int code, String login, String s) {
        this.code = code;
        this.name = login;
        this.cnName = s;
    }

    public static AdminEnum getByName(String name){
        for(AdminEnum transactType : values()){
            if (transactType.getName() .equals(name) ) {
                //获取指定的枚举
                return transactType;
            }
        }
        return NULL;
    }
}
